package com.drm.netschool.mapper;

import com.drm.netschool.entity.SumerSharedResource;
import com.drm.netschool.entity.SumerSharedResourceExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface SumerSharedResourceMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_shared_resource
     *
     * @mbggenerated Tue Oct 20 18:03:10 CST 2015
     */
    int countByExample(SumerSharedResourceExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_shared_resource
     *
     * @mbggenerated Tue Oct 20 18:03:10 CST 2015
     */
    int deleteByExample(SumerSharedResourceExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_shared_resource
     *
     * @mbggenerated Tue Oct 20 18:03:10 CST 2015
     */
    @Delete({
        "delete from sumer_shared_resource",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_shared_resource
     *
     * @mbggenerated Tue Oct 20 18:03:10 CST 2015
     */
    @Insert({
        "insert into sumer_shared_resource (id, shared_resource_id_id, ",
        "topic, availability, ",
        "author_id, create_time, ",
        "last_modify_time, concurrency_version, ",
        "down_cnt, view_cnt, ",
        "tag_id, need_integral, ",
        "del_yn, comment_cnt, ",
        "innergroup, week_downcnt)",
        "values (#{id,jdbcType=BIGINT}, #{sharedResourceIdId,jdbcType=VARCHAR}, ",
        "#{topic,jdbcType=VARCHAR}, #{availability,jdbcType=VARCHAR}, ",
        "#{authorId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{lastModifyTime,jdbcType=TIMESTAMP}, #{concurrencyVersion,jdbcType=INTEGER}, ",
        "#{downCnt,jdbcType=INTEGER}, #{viewCnt,jdbcType=INTEGER}, ",
        "#{tagId,jdbcType=BIGINT}, #{needIntegral,jdbcType=INTEGER}, ",
        "#{delYn,jdbcType=INTEGER}, #{commentCnt,jdbcType=INTEGER}, ",
        "#{innergroup,jdbcType=INTEGER}, #{weekDowncnt,jdbcType=INTEGER})"
    })
    int insert(SumerSharedResource record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_shared_resource
     *
     * @mbggenerated Tue Oct 20 18:03:10 CST 2015
     */
    int insertSelective(SumerSharedResource record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_shared_resource
     *
     * @mbggenerated Tue Oct 20 18:03:10 CST 2015
     */
    List<SumerSharedResource> selectByExample(SumerSharedResourceExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_shared_resource
     *
     * @mbggenerated Tue Oct 20 18:03:10 CST 2015
     */
    @Select({
        "select",
        "id, shared_resource_id_id, topic, availability, author_id, create_time, last_modify_time, ",
        "concurrency_version, down_cnt, view_cnt, tag_id, need_integral, del_yn, comment_cnt, ",
        "innergroup, week_downcnt",
        "from sumer_shared_resource",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @ResultMap("BaseResultMap")
    SumerSharedResource selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_shared_resource
     *
     * @mbggenerated Tue Oct 20 18:03:10 CST 2015
     */
    int updateByExampleSelective(@Param("record") SumerSharedResource record, @Param("example") SumerSharedResourceExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_shared_resource
     *
     * @mbggenerated Tue Oct 20 18:03:10 CST 2015
     */
    int updateByExample(@Param("record") SumerSharedResource record, @Param("example") SumerSharedResourceExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_shared_resource
     *
     * @mbggenerated Tue Oct 20 18:03:10 CST 2015
     */
    int updateByPrimaryKeySelective(SumerSharedResource record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_shared_resource
     *
     * @mbggenerated Tue Oct 20 18:03:10 CST 2015
     */
    @Update({
        "update sumer_shared_resource",
        "set shared_resource_id_id = #{sharedResourceIdId,jdbcType=VARCHAR},",
          "topic = #{topic,jdbcType=VARCHAR},",
          "availability = #{availability,jdbcType=VARCHAR},",
          "author_id = #{authorId,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "last_modify_time = #{lastModifyTime,jdbcType=TIMESTAMP},",
          "concurrency_version = #{concurrencyVersion,jdbcType=INTEGER},",
          "down_cnt = #{downCnt,jdbcType=INTEGER},",
          "view_cnt = #{viewCnt,jdbcType=INTEGER},",
          "tag_id = #{tagId,jdbcType=BIGINT},",
          "need_integral = #{needIntegral,jdbcType=INTEGER},",
          "del_yn = #{delYn,jdbcType=INTEGER},",
          "comment_cnt = #{commentCnt,jdbcType=INTEGER},",
          "innergroup = #{innergroup,jdbcType=INTEGER},",
          "week_downcnt = #{weekDowncnt,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(SumerSharedResource record);
}